﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace snake_class
{
    public struct point
    {
        public int x;
        public int y;
    }

    public class snake
    {
        public point[] body = new point[200];
        public int vectX = 1;
        public int vectY = 0;
        public int currentLength = 4;
        
        public snake()
        {
            for(int i=0; i<200; i++)
            {
                body[i].x = -1;
                body[i].y = -1;
            }

            body[0].x = 3;
            body[0].y = 5;

            body[1].x = 3;
            body[1].y = 6;

            body[2].x = 3;
            body[2].y = 7;

            body[3].x = 3;
            body[3].y = 8;

            body[4].x = 3;
            body[4].y = 9;
        }

        public void snakeGoNext()
        {
            for (int i = this.currentLength; i > 0; i--)
            {
                this.body[i].x = this.body[i - 1].x;
                this.body[i].y = this.body[i - 1].y;
            }
            this.body[0].x += this.vectX;
            this.body[0].y += this.vectY;
        }
    }
}
